package inline.method;

/**
 * Created by Administrator on 2018/1/25.
 */
public class Test {

    private int numberOfLateDeliveries;

    //需要重构的代码
    int getRating() {
        return (moreThanFiveLateDeliveries()) ? 2 : 1;
    }

    private boolean moreThanFiveLateDeliveries() {
        return numberOfLateDeliveries > 5;
    }

    //重构后的代码
    int getRateintRF() {
        return (numberOfLateDeliveries > 5) ? 2 : 1;
    }

}
